<template>
    <div>
        <h1>我的值是{{count}}</h1>
        <button @click="add">累加</button>
        <button @click="addN({n:3})">点击加N</button>
    </div>
</template>

<script>
import { mapMutations, mapState } from 'vuex'
    export default {
        name : 'Header',
        computed:{
            ...mapState(["count"])
        },
        methods:{
            ...mapMutations(["add","addN"])
        }
    }
</script>

<style scoped>

</style>